﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
    /// <summary>
    /// 登录账号类
    /// </summary>
    public class EM_Account
    {

        /// <summary>
        /// 主键ID
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid ID { get; set; }

        /// <summary>
        /// 账号
        /// </summary> 
        [Required]
        [StringLength(50)]
        public string? Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [MinLength(6)]
        [MaxLength(20)]
        public int Password { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Required]
        public GenderEnum Gender { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [Required]
        [StringLength(11)]
        public string? phone { get; set; }

        /// <summary>
        /// 登录时间
        /// </summary>
        [Required]
        public DateTime Time { get; set; }

        public enum GenderEnum
        {
            男 = 1,
            女 = 2,
            未知 = 0
        }
    }
}
